﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Engine.NetClasses;
namespace GameServer
{
    class Program
    {
        static Server server;
        static void Main(string[] args)
        {
            server = new Server();
            server.Init();
            server.Start();

            while (server.ServerWork)
            {
                string line = Console.ReadLine();
                server.Command = line;
            }
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
            
        }
        static void CurrentDomain_ProcessExit(object sender, EventArgs e)
        {
            if (server.ServerWork)
            {

                server.ShutDown();
            }
        }
    }
}
